package nc.ui.arap.outer;

import nc.bs.framework.exception.ComponentException;
import nc.impl.arap.proxy.Proxy;
import nc.impl.arap.proxy.ProxyBill;
import nc.ui.pub.linkoperate.ILinkQueryData;
import nc.ui.pub.pf.IUINodecodeSearcher;
import nc.vo.arap.exception.ExceptionHandler;
import nc.vo.arap.global.ResMessage;
import nc.vo.ep.dj.DJZBHeaderVO;
import nc.vo.ep.dj.DJZBVO;
import nc.vo.pub.BusinessException;

public class ARAPNodecodeSearcher implements IUINodecodeSearcher{

	public String findNodecode(ILinkQueryData lqd) {
		// TODO Auto-generated method stub
		try {
			DJZBVO djzbvo= ProxyBill.getInstance().getIArapBillPublic().findArapBillByPK(lqd.getBillID());
			DJZBHeaderVO head=(DJZBHeaderVO)djzbvo.getParentVO();
			
			if(new Integer(ResMessage.$SysCode_AR).equals(head.getPzglh())) {
				if (!head.getQcbz().booleanValue()) {
					return "2006030102";
				} else {
					return "200602";
				}
			} else  {
				if (!head.getQcbz().booleanValue()) {
					return "2008030102";
				} else {
					return "200802";
				}
			}
				
			 
		} catch (ComponentException e) {
			// TODO Auto-generated catch block
			ExceptionHandler.consume(e);
		} catch (BusinessException e) {
			// TODO Auto-generated catch block
			ExceptionHandler.consume(e);
		}
		return "2006030102";
	}

}
